//package com.per.mybootall.kafka;
//
//
//import lombok.extern.slf4j.Slf4j;
//
//import org.apache.kafka.clients.consumer.Consumer;
//import org.springframework.kafka.annotation.KafkaListener;
//import org.springframework.kafka.annotation.PartitionOffset;
//import org.springframework.kafka.annotation.TopicPartition;
//import org.springframework.kafka.support.Acknowledgment;
//import org.springframework.stereotype.Component;
//import org.springframework.util.CollectionUtils;
//
//
//import java.util.List;
//
//
///**
// * partition 分区
// * initialOffset 初始偏移量
// * groupId  分组id
// * id      消费者唯一标识
// *
// * 因为kafka没启动；先注释了
// * */
//@Slf4j
//@Component
//public class KafkaConsumer {
//    @KafkaListener(id = "yyyConsumer", topicPartitions = {
//            @TopicPartition(topic = "myKafkaTopic",
//                    partitionOffsets = @PartitionOffset(partition = "0",initialOffset = "1000"))},
//            groupId = "0")
//    @KafkaListener(id = "yyyConsumer")
//    public void onDataChangeMessage(List<String> messageList, Consumer consumer, Acknowledgment ack) {
//        if (CollectionUtils.isEmpty(messageList)) {
//            //异步提交偏移量
//            consumer.commitAsync();
//            //ack提交
//          //  ack.acknowledge();
//            return;
//        }
//
//        for (String message : messageList) {
//            System.out.println("kafka消费者1【选择从1开始消费】：------------------------------------------------------------------:" + message);
//        }
//    }
//
//
//    public static void main(String[] args) {
//        System.out.println(Integer.valueOf("aaaaa"));
//    }
//}
